package uk.co.hs.domain.web;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.Index;
import org.hibernate.annotations.Type;

import uk.co.hs.domain.generic.UtilisoftGenericDomain;

@Entity
@org.hibernate.annotations.Table(appliesTo=WebUrl.TABLE_NAME,
                                 indexes={@Index(name=WebUrl.TABLE_NAME + "_IDX_1", columnNames={UtilisoftGenericDomain.PK, UtilisoftGenericDomain.VERSION})})
@Table(name=WebUrl.TABLE_NAME)
public class WebUrl extends UtilisoftGenericDomain<Long>
{
  private static final long serialVersionUID = 1L;

  protected static final String TABLE_NAME = "WEB_URL";

  private String mUrl;
  private String mDescription;
  private Boolean mAllowByDefault;
  private Boolean mWriteByDefault;
  private Boolean mForwardableByDefault;

  /**
   * Default Constructor.
   */
  public WebUrl()
  {
    super();
  }

  /**
   * Constructor.
   *
   * @param aUrl
   * @param aAllowByDefault
   * @param aWriteByDefault
   */
  public WebUrl(String aUrl,
                Boolean aAllowByDefault,
                Boolean aWriteByDefault)
  {
    super();
    mUrl = aUrl;
    mAllowByDefault = aAllowByDefault;
    mWriteByDefault = aWriteByDefault;
  }

  /**
   * Get URL.
   * @return URL.
   */
  @Column(name="URL", nullable=false, length=100)
  public String getUrl()
  {
    return mUrl;
  }

  /**
   * Set URL.
   * @param aUrl URL.
   */
  public void setUrl(String aUrl)
  {
    mUrl = aUrl;
  }

  /**
   * Get Description.
   * @return Description.
   */
  @Column(name="DESCRIPTION", length=100)
  public String getDescription()
  {
    return mDescription;
  }

  /**
   * Set Description.
   * @param aDescription Description.
   */
  public void setDescription(String aDescription)
  {
    mDescription = aDescription;
  }

  /**
   * Is Allow By Default.
   * @return Is Allow By Default.
   */
  @Column(name="ALLOW_BY_DEFAULT", nullable=false)
  @Type(type="true_false")
  public Boolean getAllowByDefault()
  {
    return mAllowByDefault;
  }

  /**
   * Set Allow By Default.
   * @param aAllowByDefault Allow By Default.
   */
  public void setAllowByDefault(Boolean aAllowByDefault)
  {
    mAllowByDefault = aAllowByDefault;
  }

  /**
   * Is Write By Default.
   * @return Is Write By Default.
   */
  @Column(name="WRITE_BY_DEFAULT", nullable=false)
  @Type(type="true_false")
  public Boolean getWriteByDefault()
  {
    return mWriteByDefault;
  }

  /**
   * Set Write By Default.
   * @param aWriteByDefault Write By Default.
   */
  public void setWriteByDefault(Boolean aWriteByDefault)
  {
    mWriteByDefault = aWriteByDefault;
  }

  /**
   * @return the forwardableByDefault
   */
  @Column(name="FORWARDABLE_BY_DEFAULT", nullable=false)
  @Type(type="true_false")
  public Boolean getForwardableByDefault()
  {
    return mForwardableByDefault;
  }

  /**
   * @param aForwardableByDefault the forwardableByDefault to set
   */
  public void setForwardableByDefault(Boolean aForwardableByDefault)
  {
    mForwardableByDefault = aForwardableByDefault;
  }
}
